import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/inspec_task_page/inspec_task_controller.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/inspec_task_page/received_task_page/received_task_view.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/inspec_task_page/repai_task_page/repai_task_view.dart';
import 'package:enterprise_v6_app/app/modules/task/task_all/inspec_task_page/run_task_page/run_task_view.dart';

/// 我的任务
class InspecTaskPage extends StatelessWidget {
  InspecTaskPage({super.key});

  final controller = Get.put(InspecTaskController());

  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 3,
      child: GetBuilder(
          init: controller,
          builder: (_) {
            return Scaffold(
                body: Container(
                  color: const Color(0xffF5F5F6),
                  child: Column(
                    children: [
                      AppGaps.vGap12,
                      Container(
                        height: 54.w,
                        decoration: BoxDecoration(
                          color: Colors.white,
                          borderRadius: BorderRadius.circular(8.r),
                        ),
                        margin: EdgeInsets.symmetric(horizontal: 14.w),
                        child: TabBar(
                          controller: controller.tabController,
                          tabs: const [
                            Tab(text: '执行任务'),
                            Tab(text: '补检任务'),
                            Tab(text: '已领取任务'),
                          ],
                          dividerColor: Colors.transparent,
                          labelPadding: EdgeInsets.only(bottom: 20.w),
                          labelStyle: TextStyle(
                            fontSize: 16.sp,
                            fontWeight: FontWeight.w500,
                          ),
                          unselectedLabelStyle: TextStyle(
                            fontSize: 16.sp,
                            fontWeight: FontWeight.w500,
                          ),
                          labelColor: Colors.black,
                          unselectedLabelColor: const Color(0xffA0A7B5),
                          indicatorPadding: EdgeInsets.only(top: 35.w, bottom: 10.w),
                          indicator: const BoxDecoration(
                            image: DecorationImage(
                              image: AssetImage(
                                'assets/images/icon_select_arc.png',
                              ),
                            ),
                          ),
                        ),
                      ),
                      AppGaps.vGap10,
                      Expanded(
                        child: Container(
                          color: const Color(0xffF5F5F6),
                          child: TabBarView(
                            controller: controller.tabController,
                            children: [
                              RunTaskPage(),
                              RepairTaskPage(),
                              ReceivedTaskPage(),
                            ],
                          ),
                        ),
                      ),
                    ],
                  ),
                ));
          }),
    );
  }
}
